<div class="hDiv" id="alipay_set">
    <div class="hDivBox">
        <table cellspacing="0" cellpadding="0" style="width: 100%">
            <thead>
            <tr>
                <th class="sign w10" axis="col0">
                    <div class="tc"></div>
                </th>
                <th abbr="article_title" axis="col3" class="w10">
                    <div id="anchor-sms" class="tc">支付接口</div>
                </th>
                <th abbr="ac_id" axis="col4">
                    <div class=""></div>
                </th>
            </tr>
            </thead>
        </table>
    </div>
</div>
<div class="plug-list">
    {empty name="pay_api_list"}
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                        <tr>
                            <td class="no-data" align="center" axis="col0" colspan="50">
                                <div class="no_row">
                                    <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
    {else /}
        {foreach name="pay_api_list" item="vo" key="k" }
        <div class="plug-item-content">
            <div class="plug-item-top">
                <div class="plug-img">
                    <a href="JavaScript:void(0);" onclick="PayApiConfig({$vo.pay_id}, '{$vo.pay_name}');"><img src="{$vo.litpic|get_default_pic=###}"></a>
                </div>
                <div class="plug-text">
                    <div class="plug-text-title">
                        <a href="JavaScript:void(0);" onclick="PayApiConfig({$vo.pay_id}, '{$vo.pay_name}');">{$vo.pay_name}</a>
                    </div>
                    <div class="plug-text-versions">
                        <span>{eq name="$vo.system_built" value="1"}系统内置{else/}插件应用{/eq}</span>
                    </div>
                    <!-- <div class="plug-text-des">暂无描述</div> -->
                </div>
            </div>
            <div class="plug-item-bottm">
                <a href="JavaScript:void(0);" onclick="PayApiConfig({$vo.pay_id}, '{$vo.pay_name}');">配置</a>
            </div>
        </div>
        {/foreach}
        
        <!-- 内置余额支付开关 - 陈风任 -->
        <div class="plug-item-content">
            <div class="plug-item-top">
                <div class="plug-img">
                    <a href="JavaScript:void(0);"><img src="__SKIN__/images/balance.png?v={$version}"></a>
                </div>
                <div class="plug-text">
                    <div class="plug-text-title"> <a href="JavaScript:void(0);">余额支付</a> </div>
                    <div class="plug-text-versions"> <span>系统内置</span> </div>
                </div>
            </div>
            <div class="plug-item-bottm">
                <a href="JavaScript:void(0);" id="pay_balance_open1" onclick="BalancePayOpen('0');" {eq name="$pay_balance_open" value="1"} style="cursor: pointer;" {else/} style="cursor: pointer; display: none;" {/eq} title="点击关闭">已启用 </a>
                <a href="JavaScript:void(0);" id="pay_balance_open0" onclick="BalancePayOpen('1');" {eq name="$pay_balance_open" value="1"} style="cursor: pointer; color: #9ea3a7; display: none;" {else/} style="cursor: pointer; color: #9ea3a7;" {/eq} title="点击启用">已关闭 </a>
            </div>
        </div>
        <script type="text/javascript">
            function BalancePayOpen(open_value) {
                $.ajax({
                    url: "{:url('Ajax/BalancePayOpen', ['_ajax'=>1])}",
                    type: 'POST',
                    dataType: 'JSON',
                    data: {open_value: open_value},
                    success: function(res) {
                        layer.closeAll();
                        if (1 == res.code) {
                            if (1 == open_value) {
                                $('#pay_balance_open1').show();
                                $('#pay_balance_open0').hide();
                            } else {
                                $('#pay_balance_open0').show();
                                $('#pay_balance_open1').hide();
                            }
                            layer.msg(res.msg, {icon: 1, time: 1000});
                            return false;
                        } else {
                            layer.alert(res.msg, {icon: 2, title:false});
                            return false;
                        }
                    },
                    error: function(e){
                        layer.closeAll();
                        showErrorMsg(e.responseText);
                        return false;
                    }
                });
            }
        </script>
        <!-- 内置余额支付开关 - END -->
    {/empty}
</div>

<script type="text/javascript">
    function PayApiConfig(pay_id, title) {
        if (!pay_id) return false;
        var url = "{:url('PayApi/open_pay_api_config')}";
        //iframe窗
        var iframes = layer.open({
            type: 2,
            title: title,
            area: ['100%', '100%'],
            fixed: true,
            shadeClose: false,
            shade: layer_shade,
            content: url + '&pay_id=' + pay_id
        });
        layer.full(iframes);
    }
</script>